package com.one.rope.mvp.web.common.dto.admin.team;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.one.rope.mvp.web.common.enums.MemberPostEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author Weijian.Liu
 * @desc 团队成员列表返回
 * @date 2020/2/23 2:10
 */
@Data
@ApiModel
public class AdminCompanyMemberListVO {

  @ApiModelProperty(value = "成员id")
  private Long id;

  @ApiModelProperty(value = "姓名")
  private String name;

  @JsonIgnore
  private Integer postName;

  @ApiModelProperty(value = "任职岗位")
  @JsonProperty("post_name_str")
  private String postNameStr;

  @ApiModelProperty(value = "资料完善度")
  @JsonProperty("perfect_degree")
  private String perfectDegree = "30%";

  @ApiModelProperty(value = "创建时间")
  @JsonProperty("create_time")
  private Date createTime;

  public String getPostNameStr() {
    if (null != postName) {
      return MemberPostEnum.getName(postName);
    }
    return "";
  }
}
